set -e
set -o pipefail
if [ -z "${LOCATION}" ]; then LOCATION=""; fi

for d in $DIRS; do p=$(dirname ${d}); s=${d/\/home\/$(whoami)\/work\/curves/\/mnt\/${LOCATION}\/capture}; mkdir -p ${p} && if [ -d "${s}_tune" ]; then cp -ur ${s}_tune ${p}/; fi && cp -ur ${s} ${p}/; done
